home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / mlbugs.doc < prev    next >
Text File  |  1995-03-31  |  4KB  |  110 lines

  1. (Comp.sys.handhelds) Option:  
  2. Item: 3337 by _scotty at hpcvbbs.UUCP 
  3. Author: [SCOTTY THOMPSON] 
  4.   Subj: Misc. m/l string functs. hp48 
  5.   Keyw: string, m/l 
  6.   Date: Sat Jun 01 1991 14:38  
  7.  Lines: 81 
  8. ---------- 
  9.   Resp: 1 of 1 by grue at cs.uq.oz.au 
  10. Author: [Frobozz] 
  11.   Date: Wed Jun 05 1991 11:14  
  12.  Lines: 95 
  13.  
  14. In <284813da:3337comp.sys.handhelds@hpcvbbs.UUCP> akcs.scotty@hpcvbbs.UUCP 
  15. (SCOTTY THOMPSON) writes: 
  16.  
  17. >My first attempts at m/l programming (something simple, yet sweet) were 
  18. >very successful.  Thanks to all who have submitted information to the 
  19. >board! 
  20.  
  21. Don't get put off by what I'm posting, it isn't meant as a direct flame 
  22. just a word of caution to other users out there. 
  23.  
  24.  
  25. >The following code, in ASC-> format are simple string functions for 
  26. >Lower-case, Upper-case, UpperFirst (which upper-cases the first character 
  27. >after any punctuation and lower-cases the rest). 
  28.  
  29. >LC$ 
  30. >-------------------- 
  31. >%%HP: T(1)A(D)F(.); 
  32. >"D9D20D29512BF81D0040D9D20CCD20A50008FB976020143130164142818F8542 
  33. >3D816414A31149E25131A59E6C03102A6A148161818F9157D8D34150B2130B21 
  34. >3038F1" 
  35.  
  36. >{Converts string in level 1 to lower-case} 
  37.  
  38. >UC$ 
  39. >--------------------- 
  40. >%%HP: T(1)A(D)F(.); 
  41. >"D9D20D29512BF81D0040D9D20CCD20A50008FB976020143130164142818F8542 
  42. >3D816414A31169E25131A79E6C03102B6A148161818F9157D8D34150B2130B21 
  43. >30DBDF" 
  44.  
  45. >{Converts string in level 1 to upper-case} 
  46.  
  47. These two routines work quite well but they have some problems. 
  48. Firstly, they don't handle the full extended character set of the 
  49. HP48.  It is possible to get all kinds of special characters from the 
  50. keyboard.  Enter alpha mode and press: O blue-shift 9 and you should 
  51. end up with a capital O with a slash across it.  Most of these 
  52. international characters are available in both upper and lower case.  It 
  53. would be nice for these case conversion routines to handle these extra 
  54. characters properly. 
  55.  
  56. Secondly, and maybe more importantly, these routines do not make a copy 
  57. of the string before case conversion is performed.  Try this: 
  58. "AbCdEf" ENTER ENTER 
  59.  
  60. The stack should look like: 
  61. 2: "AbCdEf" 
  62. 1: "AbCdEf" 
  63.  
  64. Press UC$ and you'll get: 
  65. 2: "ABCDEF" 
  66. 1: "ABCDEF" 
  67.  
  68. and moreover, you are not able to undo the operation (try it).  This could 
  69. lead to some unexpected results! 
  70.  
  71.  
  72. Now that I've said my bit, I'll include some routines that do work as I've 
  73. indicated.  These two routines handle the entire extended character set 
  74. (except for the greek letters, there are hardly any cases where both the 
  75. lowercase and the uppercase character exist), they also duplicate the string 
  76. before conversion (try the previous test using my routines and it will 
  77. work as expected) and they also verify that they are passed a string... 
  78. (i.e. they are just about idiot proof --- famous last words :-) 
  79.  
  80. These routines take up approximately 20 extra bytes each, a small price 
  81. to pay for added safety. 
  82.  
  83.  
  84. This one converts any lowercase characters to upper case. 
  85.  
  86. "D9D20ECE81D0040D9D2075660CCD20380008FB9760147134164146819F2CECE8 
  87. AAE4D71643106AE514A9EC0331B79EAD131FD9EAE1317F9625131FF962C0310E 
  88. A6A148161CF8AF2C8F2D760142164808CB2130B2130BDE1" 
  89.  
  90.  
  91.  
  92. And this one changes upper case to lower. 
  93.  
  94. "D9D20ECE81D0040D9D2075660CCD20380008FB9760147134164146819F2CECE8 
  95. AAE4D71643104AE514A9EC0331B59EAD131FB9EAE131FD9EE51317D962C03102 
  96. A6A148161CF8AF2C8F2D760142164808CB2130B2130803A" 
  97.  
  98.  
  99.  
  100.                                                         Pauli 
  101. seeya 
  102.  
  103. Paul Dale               | Internet/CSnet:            grue@cs.uq.oz.au 
  104. Dept of Computer Science| Bitnet:       grue%cs.uq.oz.au@uunet.uu.net 
  105. Uni of Qld              | JANET:           grue%cs.uq.oz.au@uk.ac.ukc 
  106. Australia, 4072         | EAN:                          grue@cs.uq.oz 
  107.                         | UUCP:           uunet!munnari!cs.uq.oz!grue 
  108. f4e6g4Qh4++             | JUNET:                     grue@cs.uq.oz.au 
  109. -- 
  110.